{if $vpt_context}
    <a href="{$ret}?manage={$vpage->get_id()}" class="action_back">Back to virtual page &quot;{$vpage->get_path()}&quot;</a><br /><br />    
{else}
    {if $vpage}    
	    <a href="admin/modules/tangra_cms/vpage/vpage_manage.php?manage={$vpage->get_id()}" class="action_back">Back to virtual page &quot;{$vpage->get_path()}&quot;</a><br /><br />
	{/if}
    
    {if $ret}
    <a href="{$ret}?manage={$ci_id}" class="action_back">Back to content item {if $ci_title}&quot;{$ci_title|truncate:100}&quot;{/if} with ID {$ci_id}</a><br />
    <br />
    {/if}
{/if}

<div id="attachment_upload_form_div">
    <!-- *** CUT top -->
    <table width="800"  border="0" cellspacing="0" cellpadding="0" class="form" id="attachment_upload_top_table">
        <tr>
            <td align="left">
                <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <div class="form_title">Upload file</div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <!-- If you don't want notes erase this START -->
        <tr>
            <td>
                <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="form_note">
                    <!-- Repeat this fo additional notes START -->
                    <tr>
                        <td valign="top" align="left">
                            <table width="100%"  border="0" cellspacing="0" cellpadding="4" class="form_note_title">
                                <tr>
                                    <td><img src="img/modules/form_html_tpl_static_ajax_metallic/exclamation_mark.png" border="0" alt="icon exclamation mark"  width="16" height="16" /></td>
                                    <td width="100%" align="left">Note:</td>
                                </tr>
                            </table>
                        </td>
                        <td align="left" width="99%">
                            <div class="form_note_text">Fields marked with &quot;*&quot; are mandatory.</div>
                        </td>
                    </tr>
                    <!-- Repeat this fo additional notes END-->
                </table>
            </td>
        </tr>
        <!-- If you don't want notes erase this END -->
        <tr>
            <td>
                <div id="attachment_upload">
                    <form action="admin/modules/tangra_cms/attachment/attachment_upload.php" method="post" name="attachment_upload_form" enctype="multipart/form-data">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td align="left">
                                    <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="form_row">
                                        <tr>
                                            <td class="form_even_row">
                                                <!-- form_field_file attachment_upload_attachment START-->
                                                <table width="100%" border="0" cellpadding="3" cellspacing="0" class="form_row">
                                                    <tr>
                                                        <td width="180">
                                                            <div align="right">File*:</div>
                                                        </td>
                                                        <td width="1%">
                                                            <input type="hidden" name="MAX_FILE_SIZE" value="{$attachment_upload_attachment_mfs}" />
                                                            <input class="form" name="attachment_upload_attachment" type="file" id="attachment_upload_attachment" size="70"/>
                                                        </td>
                                                        <td>&nbsp;</td>
                                                    </tr>
                                                    {if $attachment_upload_attachment_has_error}
                                                    <!-- Potential errors START -->
                                                    {if $attachment_upload_attachment_error_mandatory_missing}
                                                    <!-- mandatory_missing START -->
                                                    <tr>
                                                        <td></td>
                                                        <td colspan="2">
                                                            <div class="form_error_message">Error: Field is mandatory.</div>
                                                        </td>
                                                    </tr>
                                                    <!-- mandatory_missing END -->
                                                    {/if}
                                                    {if $attachment_upload_attachment_error_size_exceeded}
                                                    <!-- size_exceeded START -->
                                                    <tr>
                                                        <td></td>
                                                        <td colspan="2">
                                                            <div class="form_error_message">Error: Uploaded file exceeds allowed size maximum.</div>
                                                        </td>
                                                    </tr>
                                                    <!-- size_exceeded END -->
                                                    {/if}
                                                    {if $attachment_upload_attachment_error_partial_upload}
                                                    <!-- partial_upload START -->
                                                    <tr>
                                                        <td></td>
                                                        <td colspan="2">
                                                            <div class="form_error_message">Error: The uploaded file was only partially uploaded.</div>
                                                        </td>
                                                    </tr>
                                                    <!-- partial_upload END -->
                                                    {/if}
                                                    {if $attachment_upload_attachment_error_invalid_extension}
                                                    <!-- invalid_extension START -->
                                                    <tr>
                                                        <td></td>
                                                        <td colspan="2">
                                                            <div class="form_error_message">Error: {include  file="modules/tangra_cms/forms/field_errors/attachment_upload/`$_language`/field_error_invalid_extension_`$_language`.tpl"}</div>
                                                        </td>
                                                    </tr>
                                                    <!-- invalid_extension END -->
                                                    {/if}
                                                    <!-- Potential errors END -->
                                                    {/if}
                                                </table>
                                                <!-- form_field_file attachment_upload_attachment END-->
                                            </td>
                                        </tr>
                                    </table>
                                    <input type="hidden" name="attachment_upload_form_id" value="{$attachment_upload_form_id_val}" id="attachment_upload_form_id"/>
                                    <input type="hidden" name="attachment_upload_guard_value" value="{$attachment_upload_guard_value_val}" id="attachment_upload_guard_value"/>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="submit_row">
                                        <tr>
                                            <td width="180">&nbsp;</td>
                                            <td width="100" align="left">
                                                <input name="attachment_upload_submit" type="submit" value="Upload" class="form_submit" />
                                            </td>
                                            <td width="50">&nbsp;</td>
                                            <td>
                                                <div class="form_cancel">
                                                    {if $ci_id && $ret}
                                                        {if $back_to_select}
                                                            <a href="admin/modules/tangra_cms/ci/ci_attachments.php?ci={$ci_id}">
                                                        {else}
                                                            <a href="{$ret}?manage={$vpage->get_id()}">
                                                        {/if}
                                                    {else}
                                                        <a href="admin/modules/tangra_cms/attachment/attachments.php">
                                                    {/if}Cancel</a></div>                                                
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>
            </td>
        </tr>
    </table>
    <!-- *** CUT bottom -->
</div>
<div class="ajax_overlay_form" id="attachment_upload_overlay" style="display:none; position: absolute; z-index: 90;" align="center"><img src="img/modules/form_html_tpl_static_ajax_metallic/indicator_medium.gif" onclick="return true;" id="attachment_upload_waiting" alt="" /></div>
<!-- Form attachment_upload END -->
